<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta content="yes" name="apple-mobile-web-app-capable">
        <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, target-densityDpi=device-dpi" />
        <!-- 微软的老式浏览器 -->
        <meta name="MobileOptimized" content="320">
        <!-- 启用360浏览器的极速模式(webkit) – -->
        <meta name="renderer" content="webkit">
        <!-- 避免IE使用兼容模式 -->
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <!-- 针对手持设备优化，主要是针对一些老的不识别viewport的浏览器，比如黑莓 -->
        <meta name="HandheldFriendly" content="true">
        <!-- uc强制竖屏 -->
        <meta name="screen-orientation" content="portrait">
        <!-- QQ强制竖屏 -->
        <meta name="x5-orientation" content="portrait">
        <!-- UC强制全屏 -->
        <meta name="full-screen" content="yes">
        <!-- QQ强制全屏 -->
        <meta name="x5-fullscreen" content="true">
        <!-- UC应用模式 若开启长按无法复制链接-->
        <!--meta name="browsermode" content="application"-->
        <!-- QQ应用模式 -->
        <meta name="x5-page-mode" content="app">
        <!--网站开启对web app程序的支持-->
        <meta name="apple-touch-fullscreen" content="yes">
        <!--在web app应用下状态条（屏幕顶部条）的颜色-->
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <!-- windows phone 点击无高光 -->
        <meta name="msapplication-tap-highlight" content="no">
        <!--移动web页面是否自动探测电话号码-->
        <!--<meta http-equiv="x-rim-auto-match" content="none">-->
        <!--手机号码显示为拨号链接-->
        <meta name="format-detection" content="telephone=no">
        <meta http-equiv="Cache-Control" content="max-age=300" />
        <meta http-equiv="Expires" content="300" />
        <title>活动详情</title>
        <link rel="stylesheet" href="../css/reset.css">
        <link rel="stylesheet" href="../css/pack.css">
        <link rel="stylesheet" href="../assets/layer_mobile/need/layer.css">
        <script src="../assets/layer_mobile/layer.js"></script>
        <script src="../js/jquery.min.js"></script>
        <script src="../js/common.js"></script>
    </head>
    <body>
      <div class="container">
        <ul>
          <li>
            <div class="top-tip">
              <img src="../images/precept.png">
                <p>方案一</p>
              </div>
            <div class="item-top">
              <div class="top-left">
                <h4>18.8%</h4>
                <p>往期年化</p>
                <span></span>
              </div>
              <div class="top-right">
                <p class="right-day">投资期限<span>30天</span></p>
                <p class="right-mon">起投金额<span>10000元</span></p>
              </div>
            </div>
            <div class="red-bag">
              <div class="master-red">
                <p>徒弟红包</p>
                <input type="text" attr="100" placeholder="100"  onkeyup="this.value=this.value.replace(/[^\d]/g,'');this.value=this.value.substr(0,3);" />
                <span>元</span>
              </div>
              <div class="apprentice-red">
                <p>师傅红包</p>
                <h4>20</h4>
                <span>元</span>
              </div>
            </div>
            <div class="tips">
              <img src="../images/pack-tip.png">
              <p>可设置红包总额：120元。徒弟与师父的奖励金额需等于120元，徒弟红包金额可设置区间：1-120元。</p>
            </div>
            <div class="pack-red">
              包红包
            </div>
          </li>
          <li>
            <div class="top-tip">
              <img src="../images/precept.png">
                <p>方案一</p>
              </div>
            <div class="item-top">
              <div class="top-left">
                <h4>18.8%</h4>
                <p>往期年化</p>
                <span></span>
              </div>
              <div class="top-right">
                <p class="right-day">投资期限<span>30天</span></p>
                <p class="right-mon">起投金额<span>10000元</span></p>
              </div>
            </div>
            <div class="red-bag">
              <div class="master-red">
                <p>徒弟红包</p>
                <input type="text" attr="100" placeholder="100"  onkeyup="this.value=this.value.replace(/[^\d]/g,'');this.value=this.value.substr(0,3);"/>
                <span>元</span>
              </div>
              <div class="apprentice-red">
                <p>师傅红包</p>
                <h4>20</h4>
                <span>元</span>
              </div>
            </div>
            <div class="tips">
              <img src="../images/pack-tip.png">
              <p>可设置红包总额：120元。徒弟与师父的奖励金额需等于120元，徒弟红包金额可设置区间：1-120元。</p>
            </div>
            <div class="pack-red">
              包红包
            </div>
          </li>
          <li>
            <div class="top-tip">
              <img src="../images/precept.png">
                <p>方案一</p>
              </div>
            <div class="item-top">
              <div class="top-left">
                <h4>18.8%</h4>
                <p>往期年化</p>
                <span></span>
              </div>
              <div class="top-right">
                <p class="right-day">投资期限<span>30天</span></p>
                <p class="right-mon">起投金额<span>10000元</span></p>
              </div>
            </div>
            <div class="red-bag">
              <div class="master-red">
                <p>徒弟红包</p>
                <input type="text" attr="120" placeholder="100"  onkeyup="this.value=this.value.replace(/[^\d]/g,'');this.value=this.value.substr(0,3);"/>
                <span>元</span>
              </div>
              <div class="apprentice-red">
                <p>师傅红包</p>
                <h4>20</h4>
                <span>元</span>
              </div>
            </div>
            <div class="tips">
              <img src="../images/pack-tip.png">
              <p>可设置红包总额：120元。徒弟与师父的奖励金额需等于120元，徒弟红包金额可设置区间：1-120元。</p>
            </div>
            <div class="pack-red">
              包红包
            </div>
          </li>
        </ul>
      </div>
      <script type="text/javascript">
      $('.pack-red').click(function(){
        var _this = $(this).prevAll('.red-bag');
        var inputV = _this.children('.master-red').children('input').val();
        var pV = _this.children('.apprentice-red').children('h4').html();
        var inputAttr = _this.children('.master-red').children('input').attr("attr");
        console.log(inputV);console.log(pV);
        console.log(inputAttr);
        console.log(parseInt(inputV)+parseInt(pV));
        if(inputV){
          if(parseInt(inputV)+parseInt(pV) > inputAttr){
            layer.open({
                content: '请输入正确的金额！'
                ,skin: 'msg'
                ,time: 2 //2秒后自动关闭
              });
          }
        }else{
            layer.open({
                content: '请输入金额！'
                ,skin: 'msg'
                ,time: 2 //2秒后自动关闭
              });
          }
      });
      </script>
    </body>
</html>